﻿//
// key.hpp
// ~~~~~~~
//

#ifndef YUTOPP_OAUTH_CORE_KEY_V2_HPP
#define YUTOPP_OAUTH_CORE_KEY_V2_HPP

#include <string>

namespace webapp
{
	namespace oauth
	{
		namespace v2
		{
			//認証データ
			class key
			{
				typedef std::string oauth_text;

			public:
				key() {}

				key( const oauth_text& client_id, const oauth_text& client_secret )
					: client_id_( client_id )
					, client_secret_( client_secret )
				{}

				void set_client_id( const oauth_text& client_id )
				{
					client_id_ = client_id;
				}
				void set_client_secret( const oauth_text& client_secret )
				{
					client_secret_ = client_secret;
				}
				const oauth_text& set_access_token( const oauth_text& access_token )
				{
					access_token_ = access_token;
				}

				const oauth_text& get_client_id() const
				{
					return client_id_;
				}
				const oauth_text& get_client_secret() const
				{
					return client_secret_;
				}
				const oauth_text& get_access_token() const
				{
					return access_token_;
				}

				bool is_complete() const
				{
					return !( client_id_.empty() || client_secret_.empty() || access_token_.empty() );
				}

			private:
				oauth_text client_id_, client_secret_;
				oauth_text access_token_;
			};
		} // - v2
	} // - oauth
} // - webapp

#endif /*YUTOPP_OAUTH_CORE_KEY_V2_HPP*/
